package com.group15.phms;

public class Dose {
	private String amount;
	private String type;
	private int hour;
	private int minute;
	
	public Dose()
	{

	}
	
	public Dose(String a, String t, int h, int m)
	{
		amount=a;
		type=t;
		hour=h;
		minute=m;
	}
	
	public String getAmount(){return amount;}
	public void setAmount(String s){amount=s;}
	
	public String getType(){return type;}
	public void setType(String s){type=s;}
	
	public int getHour(){return hour;}
	public void setHour(int i){hour=i;}
	
	public int getMinute(){return minute;}
	public void setMinute(int i){minute=i;}
	
	public String toString()
	{
		String ending;
		int thour;
		String tminute;
		
		if (hour>12){
			ending=" PM";
			thour = hour-12;
		}
		else {
			ending=" AM";
			thour=hour;
		}
		
		if (minute <10)
			tminute=String.format("0%d",minute);
		else
			tminute=String.format("%d",minute);
		
		return amount + " " + type +" at " + thour +":"+ tminute + ending;
	}
}
